package b59;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class Main1 {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String s = bf.readLine();
        String[] split = s.split("/");
        int fenzi = Integer.parseInt(split[0]);
        int fenmu = Integer.parseInt(split[1]);
        String s1 = get(fenzi, fenmu);
        System.out.println(s1);
    }
    public static String get(int fenzi,int fenmu){
        if(fenzi == 0){
            return "0";
        }
        StringBuilder res = new StringBuilder();
        if(fenzi < 0 ^ fenmu <0){
            res.append("-");
        }
        long temp = Math.abs(Long.valueOf(fenzi));
        long temp2 = Math.abs(Long.valueOf(fenmu));
        res.append(String.valueOf(temp/temp2));
        long temp3 = temp%temp2;
        if(temp3==0){
            return res.toString();
        }
        res.append(".");
        Map<Long,Integer> map = new HashMap<>();
        while(temp3!=0){
            if(map.containsKey(temp3)){
                res.insert(map.get(temp3),"(");
                res.append(")");
                break;
            }
            map.put(temp3,res.length());
            temp3 *= 10;
            res.append(String.valueOf(temp3 / fenmu));
            temp3 %= fenmu;
        }
        return res.toString();
    }
}
